package com.example.weli.ble2test;

import android.graphics.Color;

public class ColorWheelLEDController implements ColorWheel.OnColorChangedListener {
    private UIActivity mActivity;

    public ColorWheelLEDController(UIActivity activity) {
        this.mActivity = activity;
    }

    @Override
    public void colorChanged(int color) {
        int green = Color.green(color) / 8;
        int blue = Color.blue(color) / 8;
        this.mActivity.sendCommand((byte) 2, (byte) 0, (byte) (Color.red(color) / 8));
        this.mActivity.sendCommand((byte) 2, (byte) 1, (byte) green);
        this.mActivity.sendCommand((byte) 2, (byte) 2, (byte) blue);
    }
}
